// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.server.util;

import org.hibernate.proxy.HibernateProxy;

/**
 * Common utils
 * @author taviscaron
 */
public class CommonUtils {
    public static boolean isEqual(Object first, Object second) {
        return (first != null && first.equals(second));
    }

    public static Object unwrapEntity(Object proxy) {
        HibernateProxy hibernateProxy = (HibernateProxy) proxy;
        return hibernateProxy.getHibernateLazyInitializer().getImplementation();
    }
}
